class Advertisement < ActiveRecord::Base
  belongs_to :style
  attr_accessor :image
  before_save :save_image

  protected
  def save_image
    unless @image.blank?
      self.image_name=CommonFunction.upload_file(@image,"/public/images/newsimgs/")     
    end
  end
end
